package com.timothy.android.config;

import android.content.pm.ActivityInfo;

public class CanvasSetting {
	
	private int bgColor;
	private int canvasHeight;
	private int canvasWidth;
	
	private int leftMargin;
	private int rightMargin;
	private int topMargin;
	private int bottomMargin;
	
	private int space;	
	private int countOfCharts;
	private int widthOfCylinder;
	private int orientation ; 
	
	public int queTextSize ;
	public int choiceTextSize ;
	public int answerTextSize ;
	
	public final static Integer QUESTION_WRAP_LENGTH_VERTIAL = 35;
	public final static Integer QUESTION_WRAP_LENGTH_HORIZONTAL = 65;
	
	public static String CHART_QUESTION_TEXT_COLOR = "#0fffff" ;
	public static String CHART_CHOICE_TEXT_COLOR = "#0fffff" ;
	public static String CHART_ANSWER_TEXT_COLOR = "#0fffff" ;
	
	public int bulletRadius ;
	public int textLineHeight ;
	
	public CanvasSetting(){

	}
	
	public CanvasSetting(int canvasHeight,int canvasWidth,int color,int orientation){
		
		//vertical chart
		if(orientation == 1){
			space =  (int)((canvasWidth - leftMargin - rightMargin)/10.0);
			this.leftMargin = (int)(canvasWidth/10.0);
			this.rightMargin =(int) (canvasWidth/10.0);
			this.topMargin =(int) (canvasHeight/10.0);
			this.bottomMargin = (int)(canvasHeight/10.0);
		}
		//horizontal chart
		if(orientation == 2){
			space = (int)((canvasHeight - topMargin - bottomMargin)/10.0);
			this.leftMargin = (int)(canvasWidth/10.0);
			this.rightMargin =(int) (canvasWidth/10.0);
			this.topMargin =(int) (canvasHeight/10.0);
			this.bottomMargin = (int)(canvasHeight/10.0);
		}
		
		this.bgColor = color;
	}
	
	public CanvasSetting(int canvasHeight,int canvasWidth,int color,int orientation,int screensize){
		
		// vertical chart
		if(orientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT){
			space = (int)((canvasHeight - topMargin - bottomMargin)/10.0);
			this.leftMargin = (int)(canvasWidth/10.0);
			this.rightMargin =(int) (canvasWidth/10.0);
			this.topMargin =(int) (canvasHeight/10.0);
			this.bottomMargin = (int)(canvasHeight/5.0);
		}
		
		// horizontal chart
		if(orientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE){
			space =  (int)((canvasWidth - leftMargin - rightMargin)/10.0);
			this.leftMargin = (int)(canvasWidth/10.0);
			this.rightMargin =(int) (canvasWidth/10.0);
			this.topMargin =(int) (canvasHeight/10.0);
			this.bottomMargin = (int)(canvasHeight/5.0);
		}

		
		this.bgColor = color;
		
		switch(screensize){
			case 1:
				queTextSize = ConfigureL.CHART_QUESTION_TEXT_SIZE;
				choiceTextSize = ConfigureL.CHART_CHOICE_TEXT_SIZE;
				answerTextSize = ConfigureL.CHART_ANSWER_TEXT_SIZE;
				bulletRadius = ConfigureL.BULLET_RADIUS;
				textLineHeight = ConfigureL.TEXT_LINE_HEIGHT;
				break;
			case 2:
				queTextSize = ConfigureM.CHART_QUESTION_TEXT_SIZE;
				choiceTextSize = ConfigureM.CHART_CHOICE_TEXT_SIZE;
				answerTextSize = ConfigureM.CHART_ANSWER_TEXT_SIZE;
				bulletRadius = ConfigureM.BULLET_RADIUS;
				textLineHeight = ConfigureM.TEXT_LINE_HEIGHT;
				break;
			case 3:
				queTextSize = ConfigureS.CHART_QUESTION_TEXT_SIZE;
				choiceTextSize = ConfigureS.CHART_CHOICE_TEXT_SIZE;
				answerTextSize = ConfigureS.CHART_ANSWER_TEXT_SIZE;
				bulletRadius = ConfigureS.BULLET_RADIUS;
				textLineHeight = ConfigureS.TEXT_LINE_HEIGHT;
				break;
		}
	}

	public CanvasSetting(int leftMargin, int rightMargin, int topMargin,int bottomMargin, int spaceInCylis, int countOfCylinder) {
		super();
		this.leftMargin = leftMargin;
		this.rightMargin = rightMargin;
		this.topMargin = topMargin;
		this.bottomMargin = bottomMargin;
		this.space = spaceInCylis;
		this.countOfCharts = countOfCylinder;
	}
	
	public int getBgColor() {
		return bgColor;
	}

	public void setBgColor(int bgColor) {
		this.bgColor = bgColor;
	}

	public int getLeftMargin() {
		return leftMargin;
	}

	public void setLeftMargin(int leftMargin) {
		this.leftMargin = leftMargin;
	}

	public int getRightMargin() {
		return rightMargin;
	}

	public void setRightMargin(int rightMargin) {
		this.rightMargin = rightMargin;
	}

	public int getTopMargin() {
		return topMargin;
	}

	public void setTopMargin(int topMargin) {
		this.topMargin = topMargin;
	}

	public int getBottomMargin() {
		return bottomMargin;
	}

	public void setBottomMargin(int bottomMargin) {
		this.bottomMargin = bottomMargin;
	}

	public double getSpace() {
		return space;
	}

	public void setSpace(int space) {
		this.space = space;
	}

	public int getCountOfCylinder() {
		return countOfCharts;
	}

	public void setCountOfCylinder(int countOfCylinder) {
		this.countOfCharts = countOfCylinder;
	}
	
	public int getWidthOfCylinder() {
		return widthOfCylinder;
	}

	public void setWidthOfCylinder(int widthOfCylinder) {
		this.widthOfCylinder = widthOfCylinder;
	}

	public int getCanvasHeight() {
		return canvasHeight;
	}

	public void setCanvasHeight(int canvasHeight) {
		this.canvasHeight = canvasHeight;
	}

	public int getCanvasWidth() {
		return canvasWidth;
	}

	public void setCanvasWidth(int canvasWidth) {
		this.canvasWidth = canvasWidth;
	}

	public int getOrientation() {
		return orientation;
	}

	public void setOrientation(int orientation) {
		this.orientation = orientation;
	}

	public int getQueTextSize() {
		return queTextSize;
	}

	public void setQueTextSize(int queTextSize) {
		this.queTextSize = queTextSize;
	}

	public int getChoiceTextSize() {
		return choiceTextSize;
	}

	public void setChoiceTextSize(int choiceTextSize) {
		this.choiceTextSize = choiceTextSize;
	}

	public int getAnswerTextSize() {
		return answerTextSize;
	}

	public void setAnswerTextSize(int answerTextSize) {
		this.answerTextSize = answerTextSize;
	}

	public int getBulletRadius() {
		return bulletRadius;
	}

	public void setBulletRadius(int bulletRadius) {
		this.bulletRadius = bulletRadius;
	}

	public int getTextLineHeight() {
		return textLineHeight;
	}

	public void setTextLineHeight(int textLineHeight) {
		this.textLineHeight = textLineHeight;
	}
	
	
	
	



}
